import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '../components/HelloWorld'
import Login from '../components/Login'
import Employee from '../components/Employee'
import Square from "../components/Square";
import axios from 'axios'
import Line from "../components/Line";
import NotFound from "../components/404"
import Dashboard from "../components/Dashboard";

Vue.use(Router,axios)

export default new Router({
  // mode: 'history',
  mode:'hash',
  routes: [
    {
      path: '/',
      redirect: '/nebula/login'
    },
    {
      path: '/nebula/search',
      redirect: '/nebula/search/square',
      name: 'HelloWorld',
      children:[
        {
          path: '/nebula/search/square',
          component: Square,
        },
        {
          path: '/nebula/search/line',
          component : Line
        }
      ],
      component: HelloWorld
    },
    {
      path: '/nebula/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/nebula/employee/:id',
      name: 'Employee',
      component: Employee
    },
    {
     path: '*',
     name: '404',
     component: NotFound
    },
    {
      path: '/nebula/dashboard',
      name: 'dashboard',
      component: Dashboard
    }
  ]
})
